package com.uzai.console.web.zombiefanpassive;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import com.uzai.console.annotation.SystemLogType;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassivetask.ZombieFanPassiveFindByDeviceTypeDto;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassivetask.ZombieFanPassiveTaskDto;
import com.uzai.console.dto.zombiefanpassive.zombiefanpassivetask.ZombieFanPassiveTaskQuery;
import com.uzai.console.enums.OperationTypeEnum;
import com.uzai.console.enums.SystemModelEnum;
import com.uzai.console.service.zombiefanpassive.ZombieFanPassiveTaskService;
import com.uzai.console.vo.zombiefanpassive.zombiefanpassivetask.ZombieFanPassiveTaskVo;
import com.uzai.console.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 清理僵尸粉任务
 * @author liuqi
 * @date 2021年08月16日 15:11
 */
@Api(value = "被动僵尸粉添加任务",tags = "僵尸粉|被动僵尸粉添加任务")
@ApiSort(31)
@RestController
public class ZombieFanPassiveTaskController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(ZombieFanPassiveTaskController.class);

    @Autowired
    private ZombieFanPassiveTaskService zombieFanPassiveTaskService;

    @ApiOperation(value = "分页查询被动僵尸粉任务列表", notes = "分页查询被动僵尸粉任务列表", response = ZombieFanPassiveTaskVo.class)
    @ApiOperationSupport(order = 1)
    @PostMapping("/zombieFanTask/findByPage")
    public Object findZombieFanPassiveTaskPage(@RequestBody ZombieFanPassiveTaskQuery zombieFanPassiveTaskQuery){
        return zombieFanPassiveTaskService.findZombieFanPassiveTaskList(zombieFanPassiveTaskQuery);
    }

    @ApiOperation(value = "根据设备类型查询被动僵尸粉任务详情", notes = "根据设备类型查询被动僵尸粉任务详情", response = ZombieFanPassiveTaskVo.class)
    @ApiOperationSupport(order = 2)
    @PostMapping("/zombieFanPassiveTask/findById")
    public Object findZombieFanPassiveTask(@RequestBody ZombieFanPassiveFindByDeviceTypeDto zombieFanPassiveFindByDeviceTypeDto){
        return zombieFanPassiveTaskService.findZombieFanPassiveTaskByDevice(zombieFanPassiveFindByDeviceTypeDto);
    }

    @SystemLogType(model = SystemModelEnum.ZombieFanPassiveTask, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "添加被动僵尸粉添加任务", notes = "添加被动僵尸粉添加任务")
    @ApiOperationSupport(order = 3)
    @PostMapping("/zombieFanPassiveTask/add")
    public Object addZombieFanPassiveTask(@RequestBody ZombieFanPassiveTaskDto zombieFanPassiveTaskDto){
        zombieFanPassiveTaskService.addZombieFanPassiveTask(zombieFanPassiveTaskDto);
        return true;
    }

    @SystemLogType(model = SystemModelEnum.ZombieFanPassiveTask, type = OperationTypeEnum.ADD)
    @ApiOperation(value = "修改被动僵尸粉添加任务", notes = "修改被动僵尸粉添加任务")
    @ApiOperationSupport(order = 4)
    @PostMapping("/zombieFanPassiveTask/update")
    public Object updateZombieFanPassiveTask(@RequestBody ZombieFanPassiveTaskDto zombieFanPassiveTaskDto){
        zombieFanPassiveTaskService.updateZombieFanPassiveTask(zombieFanPassiveTaskDto);
        return true;
    }


}
